<!--
 * @Date: 2023-08-31 11:47:33
 * @LastEditTime: 2023-10-11 17:08:11
 * 介绍:
-->
<route lang="json">
{
  "meta": {
    "title": "t('zhong-cai-ju')",
    "navbar": {
      "buttons": [
        {
          "icon": "icon-xialacaidan",
          "pubSubKey": "__wkMenu__"
        }
      ]
    }
  }
}
</route>
<script lang="ts" setup>
import { _require } from "@@/utils/tools";
import dayjs from "dayjs";
import { apiTaskArbitrateList, ApiTaskArbitrateList } from "@@/api/wk/list";
import router from "@@/router";
import omit from "lodash/omit";
function toTaskDetail(item: ApiTaskArbitrateList.DataItem) {
  router.push({
    name: "wk-taskDetails",
    query: {
      json: JSON.stringify(item.task),
      arbitration: JSON.stringify(omit(item, ["task"])),
    },
  });
}
</script>
<template>
  <CpageView>
    <CrequestList :api="apiTaskArbitrateList">
      <template #item="{ item }">
        <Ccard @click="toTaskDetail(item)" class="MT-md">
          <div class="auto-MT-md">
            <h4>
              <CcopyText :copy-text="item.task.task_no">
                NO.{{ item.task.task_no }}
              </CcopyText>
            </h4>
            <Ccard bg="var(--C-B3)" class="T-A-C">
              <h3>{{ item.title }}</h3>
            </Ccard>
            <div class="T-S-sm">
              {{ dayjs(item.created_at).format("YYYY-MM-DD HH:mm:ss") }}
            </div>
            <Rbutton bg="var(--C-LG1)" borderStyle="none" :size="'large'">
              <span v-if="item.can_arbitrate === 0">
                {{ $t("chaKanXiangQing") }}
              </span>
              <span v-else>{{ $t("can-yu-zhong-cai") }}</span>
            </Rbutton>
          </div>
        </Ccard>
      </template>
    </CrequestList>
  </CpageView>
</template>
<style lang="scss" scoped></style>
